package store

import (
	"auth/model"
	"auth/model/entity"
	"context"
	"proto/dto"
)

type IUser interface {
	Create(e *entity.User) (int64, error)
	Find(id int64) (*entity.User, error)
	Update(id int64, updates map[string]interface{}) error
	Delete(id int64) error
	List(in *model.UserListRequest) (int64, []*entity.User, error)
	FindByParameter(in *model.UserInfo) (*entity.User, error)
	Count(user int64) (*model.UserCount, error)
	UserListByIds(in dto.UserListInfoRequest) (out dto.UserListInfoResponse, err error)
	GetSysUserList(in *model.GetSysUserListRequest, deptIds []int64) (int64, []*model.GetSysUserList, error)
	CheckDeptExistUser(deptId int64) (int64, error)
	FindUserByPhone(phone string) (entity.User, error)
	// AllUserIds 获取所有用户id
	AllUserIds() (ids []int64, err error)
}

type IUserRedis interface {
	CheckVerificationCode(ctx context.Context, phone, code string) bool
	DeleteVerificationCode(ctx context.Context, phone string) error
	SetToken(ctx context.Context, userId int64, token string) error
	ExistsToken(ctx context.Context, userId int64, token string) bool
}
